package uml.behavioral.responsibility_chain;

/**
 * 职责链--抽象处理者<br>
 * on 2023/1/1 1:30
 */
public class VicePresident extends Approver {
    public VicePresident(String name) {
        super(name);
        this.job = "副董事长";
    }

    @Override
    public void dealWith(PurchaseRequest request) {
        if (request.getAmount() >= 5 && request.getAmount() < 10) {
            this.agree(request);
        } else {
            this.nextApprover.dealWith(request);
        }
    }
}
